from user import models
from rest_framework import serializers

class ClasSer(serializers.ModelSerializer):
    tname = serializers.SerializerMethodField(read_only=True)
    def get_tname(self,obj):
        return obj.teacher.name
    class Meta:
        model = models.clas
        fields = '__all__'

class TeacherSer(serializers.ModelSerializer):

    class Meta:
        model = models.Teacher
        fields = '__all__'

